3.6.2 \(\int \cot ^{\frac {7}{2}}(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx\) [502]

3.6.2.1 Optimal result
3.6.2.2 Mathematica [C] (verified)
3.6.2.3 Rubi [A] (verified)
3.6.2.4 Maple [B] (verified)
3.6.2.5 Fricas [B] (verification not implemented)
3.6.2.6 Sympy [F(-1)]
3.6.2.7 Maxima [B] (verification not implemented)
3.6.2.8 Giac [F]
3.6.2.9 Mupad [F(-1)]

3.6.2.1 Optimal result

Integrand size = 34, antiderivative size = 103 \[ \int \cot ^{\frac {7}{2}}(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx=\frac {2 \sqrt [4]{-1} a (A-i B) \text {arctanh}\left ((-1)^{3/4} \sqrt {\cot (c+d x)}\right )}{d}+\frac {2 a (A-i B) \sqrt {\cot (c+d x)}}{d}-\frac {2 a (i A+B) \cot ^{\frac {3}{2}}(c+d x)}{3 d}-\frac {2 a A \cot ^{\frac {5}{2}}(c+d x)}{5 d} \]

output
2*(-1)^(1/4)*a*(A-I*B)*arctanh((-1)^(3/4)*cot(d*x+c)^(1/2))/d-2/3*a*(I*A+B 
)*cot(d*x+c)^(3/2)/d-2/5*a*A*cot(d*x+c)^(5/2)/d+2*a*(A-I*B)*cot(d*x+c)^(1/ 
2)/d
 
3.6.2.2 Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.

Time = 0.76 (sec) , antiderivative size = 55, normalized size of antiderivative = 0.53 \[ \int \cot ^{\frac {7}{2}}(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx=-\frac {2 a \cot ^{\frac {3}{2}}(c+d x) \left (3 A \cot (c+d x)+5 (i A+B) \operatorname {Hypergeometric2F1}\left (-\frac {3}{2},1,-\frac {1}{2},i \tan (c+d x)\right )\right )}{15 d} \]

input
Integrate[Cot[c + d*x]^(7/2)*(a + I*a*Tan[c + d*x])*(A + B*Tan[c + d*x]),x 
]
 
output
(-2*a*Cot[c + d*x]^(3/2)*(3*A*Cot[c + d*x] + 5*(I*A + B)*Hypergeometric2F1 
[-3/2, 1, -1/2, I*Tan[c + d*x]]))/(15*d)
 
3.6.2.3 Rubi [A] (verified)

Time = 0.70 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.324, Rules used = {3042, 4064, 3042, 4075, 3042, 4011, 3042, 4011, 3042, 4016, 221}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \cot ^{\frac {7}{2}}(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \cot (c+d x)^{7/2} (a+i a \tan (c+d x)) (A+B \tan (c+d x))dx\)

\(\Big \downarrow \) 4064

\(\displaystyle \int \cot ^{\frac {3}{2}}(c+d x) (a \cot (c+d x)+i a) (A \cot (c+d x)+B)dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \left (-\tan \left (c+d x+\frac {\pi }{2}\right )\right )^{3/2} \left (-a \tan \left (c+d x+\frac {\pi }{2}\right )+i a\right ) \left (B-A \tan \left (c+d x+\frac {\pi }{2}\right )\right )dx\)

\(\Big \downarrow \) 4075

\(\displaystyle -\frac {2 a A \cot ^{\frac {5}{2}}(c+d x)}{5 d}+\int \cot ^{\frac {3}{2}}(c+d x) (a (i A+B) \cot (c+d x)-a (A-i B))dx\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {2 a A \cot ^{\frac {5}{2}}(c+d x)}{5 d}+\int \left (-\tan \left (c+d x+\frac {\pi }{2}\right )\right )^{3/2} \left (-a (A-i B)-a (i A+B) \tan \left (c+d x+\frac {\pi }{2}\right )\right )dx\)

\(\Big \downarrow \) 4011

\(\displaystyle \int \sqrt {\cot (c+d x)} (-a (i A+B)-a (A-i B) \cot (c+d x))dx-\frac {2 a (B+i A) \cot ^{\frac {3}{2}}(c+d x)}{3 d}-\frac {2 a A \cot ^{\frac {5}{2}}(c+d x)}{5 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \sqrt {-\tan \left (c+d x+\frac {\pi }{2}\right )} \left (a (A-i B) \tan \left (c+d x+\frac {\pi }{2}\right )-a (i A+B)\right )dx-\frac {2 a (B+i A) \cot ^{\frac {3}{2}}(c+d x)}{3 d}-\frac {2 a A \cot ^{\frac {5}{2}}(c+d x)}{5 d}\)

\(\Big \downarrow \) 4011

\(\displaystyle \int \frac {a (A-i B)-a (i A+B) \cot (c+d x)}{\sqrt {\cot (c+d x)}}dx-\frac {2 a (B+i A) \cot ^{\frac {3}{2}}(c+d x)}{3 d}+\frac {2 a (A-i B) \sqrt {\cot (c+d x)}}{d}-\frac {2 a A \cot ^{\frac {5}{2}}(c+d x)}{5 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {a (A-i B)+a (i A+B) \tan \left (c+d x+\frac {\pi }{2}\right )}{\sqrt {-\tan \left (c+d x+\frac {\pi }{2}\right )}}dx-\frac {2 a (B+i A) \cot ^{\frac {3}{2}}(c+d x)}{3 d}+\frac {2 a (A-i B) \sqrt {\cot (c+d x)}}{d}-\frac {2 a A \cot ^{\frac {5}{2}}(c+d x)}{5 d}\)

\(\Big \downarrow \) 4016

\(\displaystyle \frac {2 a^2 (A-i B)^2 \int \frac {1}{-a (A-i B)-a (i A+B) \cot (c+d x)}d\sqrt {\cot (c+d x)}}{d}-\frac {2 a (B+i A) \cot ^{\frac {3}{2}}(c+d x)}{3 d}+\frac {2 a (A-i B) \sqrt {\cot (c+d x)}}{d}-\frac {2 a A \cot ^{\frac {5}{2}}(c+d x)}{5 d}\)

\(\Big \downarrow \) 221

\(\displaystyle \frac {2 \sqrt [4]{-1} a (A-i B) \text {arctanh}\left ((-1)^{3/4} \sqrt {\cot (c+d x)}\right )}{d}-\frac {2 a (B+i A) \cot ^{\frac {3}{2}}(c+d x)}{3 d}+\frac {2 a (A-i B) \sqrt {\cot (c+d x)}}{d}-\frac {2 a A \cot ^{\frac {5}{2}}(c+d x)}{5 d}\)

input
Int[Cot[c + d*x]^(7/2)*(a + I*a*Tan[c + d*x])*(A + B*Tan[c + d*x]),x]
 
output
(2*(-1)^(1/4)*a*(A - I*B)*ArcTanh[(-1)^(3/4)*Sqrt[Cot[c + d*x]]])/d + (2*a 
*(A - I*B)*Sqrt[Cot[c + d*x]])/d - (2*a*(I*A + B)*Cot[c + d*x]^(3/2))/(3*d 
) - (2*a*A*Cot[c + d*x]^(5/2))/(5*d)
 

3.6.2.3.1 Defintions of rubi rules used

rule 221
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x 
/Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4011
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)]), x_Symbol] :> Simp[d*((a + b*Tan[e + f*x])^m/(f*m)), x] + Int 
[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x], x] 
, x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 
 0] && GtQ[m, 0]
 

rule 4016
Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/Sqrt[(b_.)*tan[(e_.) + (f_.)*(x_ 
)]], x_Symbol] :> Simp[2*(c^2/f)   Subst[Int[1/(b*c - d*x^2), x], x, Sqrt[b 
*Tan[e + f*x]]], x] /; FreeQ[{b, c, d, e, f}, x] && EqQ[c^2 + d^2, 0]
 

rule 4064
Int[(cot[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_.) + (b_.)*tan[(e_.) + (f_.)*( 
x_)])^(m_.)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Simp 
[g^(m + n)   Int[(g*Cot[e + f*x])^(p - m - n)*(b + a*Cot[e + f*x])^m*(d + c 
*Cot[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, g, p}, x] &&  !Integer 
Q[p] && IntegerQ[m] && IntegerQ[n]
 

rule 4075
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) 
+ (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[B 
*d*((a + b*Tan[e + f*x])^(m + 1)/(b*f*(m + 1))), x] + Int[(a + b*Tan[e + f* 
x])^m*Simp[A*c - B*d + (B*c + A*d)*Tan[e + f*x], x], x] /; FreeQ[{a, b, c, 
d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0] &&  !LeQ[m, -1]
 
3.6.2.4 Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 550 vs. \(2 (84 ) = 168\).

Time = 0.61 (sec) , antiderivative size = 551, normalized size of antiderivative = 5.35

method result size
derivativedivides \(-\frac {a \left (\frac {1}{\tan \left (d x +c \right )}\right )^{\frac {7}{2}} \tan \left (d x +c \right ) \left (30 i A \sqrt {2}\, \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}+30 i B \sqrt {2}\, \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}+30 i B \sqrt {2}\, \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}+15 i B \sqrt {2}\, \ln \left (-\frac {\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}-\tan \left (d x +c \right )-1}{1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+\tan \left (d x +c \right )}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}+15 i A \sqrt {2}\, \ln \left (-\frac {1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+\tan \left (d x +c \right )}{\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}-\tan \left (d x +c \right )-1}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}+40 i A \tan \left (d x +c \right )-30 A \sqrt {2}\, \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}-30 A \sqrt {2}\, \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}-15 A \sqrt {2}\, \ln \left (-\frac {\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}-\tan \left (d x +c \right )-1}{1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+\tan \left (d x +c \right )}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}+15 B \sqrt {2}\, \ln \left (-\frac {1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+\tan \left (d x +c \right )}{\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}-\tan \left (d x +c \right )-1}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}+30 B \sqrt {2}\, \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}+30 B \sqrt {2}\, \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}+30 i A \sqrt {2}\, \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}-120 A \tan \left (d x +c \right )^{2}+120 i B \tan \left (d x +c \right )^{2}+40 B \tan \left (d x +c \right )+24 A \right )}{60 d}\) \(551\)
default \(-\frac {a \left (\frac {1}{\tan \left (d x +c \right )}\right )^{\frac {7}{2}} \tan \left (d x +c \right ) \left (30 i A \sqrt {2}\, \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}+30 i B \sqrt {2}\, \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}+30 i B \sqrt {2}\, \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}+15 i B \sqrt {2}\, \ln \left (-\frac {\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}-\tan \left (d x +c \right )-1}{1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+\tan \left (d x +c \right )}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}+15 i A \sqrt {2}\, \ln \left (-\frac {1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+\tan \left (d x +c \right )}{\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}-\tan \left (d x +c \right )-1}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}+40 i A \tan \left (d x +c \right )-30 A \sqrt {2}\, \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}-30 A \sqrt {2}\, \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}-15 A \sqrt {2}\, \ln \left (-\frac {\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}-\tan \left (d x +c \right )-1}{1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+\tan \left (d x +c \right )}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}+15 B \sqrt {2}\, \ln \left (-\frac {1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+\tan \left (d x +c \right )}{\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}-\tan \left (d x +c \right )-1}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}+30 B \sqrt {2}\, \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}+30 B \sqrt {2}\, \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}+30 i A \sqrt {2}\, \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right ) \tan \left (d x +c \right )^{\frac {5}{2}}-120 A \tan \left (d x +c \right )^{2}+120 i B \tan \left (d x +c \right )^{2}+40 B \tan \left (d x +c \right )+24 A \right )}{60 d}\) \(551\)

input
int(cot(d*x+c)^(7/2)*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x,method=_RETURNV 
ERBOSE)
 
output
-1/60*a/d*(1/tan(d*x+c))^(7/2)*tan(d*x+c)*(30*I*A*2^(1/2)*arctan(-1+2^(1/2 
)*tan(d*x+c)^(1/2))*tan(d*x+c)^(5/2)+30*I*B*2^(1/2)*arctan(-1+2^(1/2)*tan( 
d*x+c)^(1/2))*tan(d*x+c)^(5/2)+30*I*B*2^(1/2)*arctan(1+2^(1/2)*tan(d*x+c)^ 
(1/2))*tan(d*x+c)^(5/2)+15*I*B*2^(1/2)*ln(-(2^(1/2)*tan(d*x+c)^(1/2)-tan(d 
*x+c)-1)/(1+2^(1/2)*tan(d*x+c)^(1/2)+tan(d*x+c)))*tan(d*x+c)^(5/2)+15*I*A* 
2^(1/2)*ln(-(1+2^(1/2)*tan(d*x+c)^(1/2)+tan(d*x+c))/(2^(1/2)*tan(d*x+c)^(1 
/2)-tan(d*x+c)-1))*tan(d*x+c)^(5/2)+40*I*A*tan(d*x+c)-30*A*2^(1/2)*arctan( 
1+2^(1/2)*tan(d*x+c)^(1/2))*tan(d*x+c)^(5/2)-30*A*2^(1/2)*arctan(-1+2^(1/2 
)*tan(d*x+c)^(1/2))*tan(d*x+c)^(5/2)-15*A*2^(1/2)*ln(-(2^(1/2)*tan(d*x+c)^ 
(1/2)-tan(d*x+c)-1)/(1+2^(1/2)*tan(d*x+c)^(1/2)+tan(d*x+c)))*tan(d*x+c)^(5 
/2)+15*B*2^(1/2)*ln(-(1+2^(1/2)*tan(d*x+c)^(1/2)+tan(d*x+c))/(2^(1/2)*tan( 
d*x+c)^(1/2)-tan(d*x+c)-1))*tan(d*x+c)^(5/2)+30*B*2^(1/2)*arctan(1+2^(1/2) 
*tan(d*x+c)^(1/2))*tan(d*x+c)^(5/2)+30*B*2^(1/2)*arctan(-1+2^(1/2)*tan(d*x 
+c)^(1/2))*tan(d*x+c)^(5/2)+30*I*A*2^(1/2)*arctan(1+2^(1/2)*tan(d*x+c)^(1/ 
2))*tan(d*x+c)^(5/2)-120*A*tan(d*x+c)^2+120*I*B*tan(d*x+c)^2+40*B*tan(d*x+ 
c)+24*A)
 
3.6.2.5 Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 434 vs. \(2 (81) = 162\).

Time = 0.27 (sec) , antiderivative size = 434, normalized size of antiderivative = 4.21 \[ \int \cot ^{\frac {7}{2}}(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx=-\frac {15 \, {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {-\frac {{\left (-i \, A^{2} - 2 \, A B + i \, B^{2}\right )} a^{2}}{d^{2}}} \log \left (-\frac {2 \, {\left ({\left (A - i \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} - {\left (i \, d e^{\left (2 i \, d x + 2 i \, c\right )} - i \, d\right )} \sqrt {-\frac {{\left (-i \, A^{2} - 2 \, A B + i \, B^{2}\right )} a^{2}}{d^{2}}} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{{\left (i \, A + B\right )} a}\right ) - 15 \, {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {-\frac {{\left (-i \, A^{2} - 2 \, A B + i \, B^{2}\right )} a^{2}}{d^{2}}} \log \left (-\frac {2 \, {\left ({\left (A - i \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} - {\left (-i \, d e^{\left (2 i \, d x + 2 i \, c\right )} + i \, d\right )} \sqrt {-\frac {{\left (-i \, A^{2} - 2 \, A B + i \, B^{2}\right )} a^{2}}{d^{2}}} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{{\left (i \, A + B\right )} a}\right ) - 4 \, {\left ({\left (23 \, A - 20 i \, B\right )} a e^{\left (4 i \, d x + 4 i \, c\right )} - 6 \, {\left (4 \, A - 5 i \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (13 \, A - 10 i \, B\right )} a\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}}{30 \, {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]

input
integrate(cot(d*x+c)^(7/2)*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorith 
m="fricas")
 
output
-1/30*(15*(d*e^(4*I*d*x + 4*I*c) - 2*d*e^(2*I*d*x + 2*I*c) + d)*sqrt(-(-I* 
A^2 - 2*A*B + I*B^2)*a^2/d^2)*log(-2*((A - I*B)*a*e^(2*I*d*x + 2*I*c) - (I 
*d*e^(2*I*d*x + 2*I*c) - I*d)*sqrt(-(-I*A^2 - 2*A*B + I*B^2)*a^2/d^2)*sqrt 
((I*e^(2*I*d*x + 2*I*c) + I)/(e^(2*I*d*x + 2*I*c) - 1)))*e^(-2*I*d*x - 2*I 
*c)/((I*A + B)*a)) - 15*(d*e^(4*I*d*x + 4*I*c) - 2*d*e^(2*I*d*x + 2*I*c) + 
 d)*sqrt(-(-I*A^2 - 2*A*B + I*B^2)*a^2/d^2)*log(-2*((A - I*B)*a*e^(2*I*d*x 
 + 2*I*c) - (-I*d*e^(2*I*d*x + 2*I*c) + I*d)*sqrt(-(-I*A^2 - 2*A*B + I*B^2 
)*a^2/d^2)*sqrt((I*e^(2*I*d*x + 2*I*c) + I)/(e^(2*I*d*x + 2*I*c) - 1)))*e^ 
(-2*I*d*x - 2*I*c)/((I*A + B)*a)) - 4*((23*A - 20*I*B)*a*e^(4*I*d*x + 4*I* 
c) - 6*(4*A - 5*I*B)*a*e^(2*I*d*x + 2*I*c) + (13*A - 10*I*B)*a)*sqrt((I*e^ 
(2*I*d*x + 2*I*c) + I)/(e^(2*I*d*x + 2*I*c) - 1)))/(d*e^(4*I*d*x + 4*I*c) 
- 2*d*e^(2*I*d*x + 2*I*c) + d)
 
3.6.2.6 Sympy [F(-1)]

Timed out. \[ \int \cot ^{\frac {7}{2}}(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx=\text {Timed out} \]

input
integrate(cot(d*x+c)**(7/2)*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x)
 
output
Timed out
 
3.6.2.7 Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 190 vs. \(2 (81) = 162\).

Time = 0.37 (sec) , antiderivative size = 190, normalized size of antiderivative = 1.84 \[ \int \cot ^{\frac {7}{2}}(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx=\frac {15 \, {\left (2 \, \sqrt {2} {\left (\left (i - 1\right ) \, A + \left (i + 1\right ) \, B\right )} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} + \frac {2}{\sqrt {\tan \left (d x + c\right )}}\right )}\right ) + 2 \, \sqrt {2} {\left (\left (i - 1\right ) \, A + \left (i + 1\right ) \, B\right )} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} - \frac {2}{\sqrt {\tan \left (d x + c\right )}}\right )}\right ) + \sqrt {2} {\left (-\left (i + 1\right ) \, A + \left (i - 1\right ) \, B\right )} \log \left (\frac {\sqrt {2}}{\sqrt {\tan \left (d x + c\right )}} + \frac {1}{\tan \left (d x + c\right )} + 1\right ) - \sqrt {2} {\left (-\left (i + 1\right ) \, A + \left (i - 1\right ) \, B\right )} \log \left (-\frac {\sqrt {2}}{\sqrt {\tan \left (d x + c\right )}} + \frac {1}{\tan \left (d x + c\right )} + 1\right )\right )} a + \frac {120 \, {\left (A - i \, B\right )} a}{\sqrt {\tan \left (d x + c\right )}} + \frac {40 \, {\left (-i \, A - B\right )} a}{\tan \left (d x + c\right )^{\frac {3}{2}}} - \frac {24 \, A a}{\tan \left (d x + c\right )^{\frac {5}{2}}}}{60 \, d} \]

input
integrate(cot(d*x+c)^(7/2)*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorith 
m="maxima")
 
output
1/60*(15*(2*sqrt(2)*((I - 1)*A + (I + 1)*B)*arctan(1/2*sqrt(2)*(sqrt(2) + 
2/sqrt(tan(d*x + c)))) + 2*sqrt(2)*((I - 1)*A + (I + 1)*B)*arctan(-1/2*sqr 
t(2)*(sqrt(2) - 2/sqrt(tan(d*x + c)))) + sqrt(2)*(-(I + 1)*A + (I - 1)*B)* 
log(sqrt(2)/sqrt(tan(d*x + c)) + 1/tan(d*x + c) + 1) - sqrt(2)*(-(I + 1)*A 
 + (I - 1)*B)*log(-sqrt(2)/sqrt(tan(d*x + c)) + 1/tan(d*x + c) + 1))*a + 1 
20*(A - I*B)*a/sqrt(tan(d*x + c)) + 40*(-I*A - B)*a/tan(d*x + c)^(3/2) - 2 
4*A*a/tan(d*x + c)^(5/2))/d
 
3.6.2.8 Giac [F]

\[ \int \cot ^{\frac {7}{2}}(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx=\int { {\left (B \tan \left (d x + c\right ) + A\right )} {\left (i \, a \tan \left (d x + c\right ) + a\right )} \cot \left (d x + c\right )^{\frac {7}{2}} \,d x } \]

input
integrate(cot(d*x+c)^(7/2)*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorith 
m="giac")
 
output
integrate((B*tan(d*x + c) + A)*(I*a*tan(d*x + c) + a)*cot(d*x + c)^(7/2), 
x)
 
3.6.2.9 Mupad [F(-1)]

Timed out. \[ \int \cot ^{\frac {7}{2}}(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx=\int {\mathrm {cot}\left (c+d\,x\right )}^{7/2}\,\left (A+B\,\mathrm {tan}\left (c+d\,x\right )\right )\,\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right ) \,d x \]

input
int(cot(c + d*x)^(7/2)*(A + B*tan(c + d*x))*(a + a*tan(c + d*x)*1i),x)
 
output
int(cot(c + d*x)^(7/2)*(A + B*tan(c + d*x))*(a + a*tan(c + d*x)*1i), x)